package com.hyxt.DTO;

import com.hyxt.superviseservice.IMessage;
import com.hyxt.superviseservice.IMessageBody;
import com.hyxt.superviseservice.IMessageHeader;

import java.io.Serializable;

/**
 * @Project CNPC_VMS
 * @Title CommonMessage
 * @Description 公共消息类
 * @author guanhl
 * @date 2014年8月7日 上午9:28:34
 * @company Beijing Huayou Information andCommunication Technology Co.,Ltd
 * @Copyright Copyright (c) 2014
 * @version V2.0
 */
public class CommonMessage<B extends IMessageBody> implements IMessage<B>,Serializable {

	private static final long serialVersionUID = 4704385741635683847L;
	// 消息头
	private IMessageHeader messageHeader;

	// 消息体
	private B messageBody;

	// 消息id
	private Object messageID;

	/**
	 * @Description 构造方法
	 * @param messageID 消息id
	 * @param header 消息头
	 * @param body 消息体
	 */
	public CommonMessage(Object messageID, IMessageHeader header, B body) {
		this.messageID = messageID;
		this.messageHeader = header;
		this.messageBody = (B) body;
	}

	/**
	 * @Description 获取messageHeader属性
	 */
	@Override
	public IMessageHeader getMessageHeader() {
		return messageHeader;
	}

	/**
	 * @Description 设置messageHeader属性
	 */
	public void setMessageHeader(IMessageHeader messageHeader) {
		this.messageHeader = messageHeader;
	}

	/**
	 * @Description 获取messageBody属性
	 */
	@Override
	public B getMessageBody() {
		return messageBody;
	}

	/**
	 * @Description 设置messageBody属性
	 */
	public void setMessageBody(B messageBody) {
		this.messageBody = messageBody;
	}

	/**
	 * @Description 获取messageID属性
	 */
	@Override
	public Object getMessageID() {
		return messageID;
	}

	/**
	 * @Description 设置messageID属性
	 */
	public void setMessageID(Object messageID) {
		this.messageID = messageID;
	}

}
